@extends('layout')
@section('content')
<div class="bloque">
	<div class="row">
		<input type="text" class="form-control" id="yo" data-action="filter" data-filters="#dev-table" placeholder="Filtrar Ganado" />
	</div>
</div>
<div class="bloque">
	<div class="row">
		<table class="table-bordered table-hover" id="dev-table">
		    <thead> 
		        <tr class="danger" >
		            <th width="100px">Fecha de Ingreso</th>
		            <th width="100px">Fecha de Venta</th>
		            <th>C&oacute;digo de res</th>
		            <th>Sexo</th>
		            <th>Color</th>
		            <th>Raza</th>
		            <th>Costo x Kg (Compra)</th>
		            <th>Peso en Kg  (Compra)</th>
		            <th>Precio Total (Compra)</th>
		            <th>Costo x Kg (Venta)</th>
		            <th>Peso en Kg  (Venta)</th>
		            <th>Precio Total (Venta)</th>
		            <th>Ganancia</th>
		            <th>D&iacute;as de cr&iacute;a</th>
		            <th>Ganancia por d&iacute;a</th>

		        </tr>
		    </thead>
		    <tbody> 
		    	{{--*/$total_ganancias = 0;$totalxdias=0;/*--}}
		    	@foreach($detalledatos as $detalles)

		        <tr>
		        	<center></center>
		            <td width="100px"><center>{{$detalles->fecha_nacimiento}}</center></td>
		            <td width="100px"><center>{{$detalles->fecha}}</center></td>
		            <td><center>{{$detalles->cod_ganado}}</center></td>
		            <td><center>{{$detalles->sexo}}</center></td>
		            <td><center>{{$detalles->color}}</center></td>
		            <td><center>{{$detalles->raza}}</center></td>
		            <td class="info"><center>{{$detalles->costo_kilo}}</center></td>
		            <td class="info"><center>{{$detalles->peso_kilo}}</center></td>
		            <td class="info"><center>${{$detalles->costo_bruto}}</center></td>
		            <td class="warning"><center>{{$detalles->precio_kilo}}</center></td>
		            <td class="warning"><center>{{$detalles->peso}}</center></td>
		            <td class="warning"><center>${{$detalles->precio_bruto}}</center></td>
		            <td><center>${{$detalles->ganancia}}</center></td>
		            <td><center>{{$detalles->dias}}</center></td>
		            <td><center>${{$detalles->ganancias_dias}}</center></td>
		            @if($detalles->ganancia <0)
		            {{--*/$total_ganancias =  $total_ganancias - ($detalles->ganancia*1);/*--}}
		            @else
		            {{--*/$total_ganancias =  $total_ganancias + ($detalles->ganancia*1);/*--}}
		            @endif
		            @if($detalles->ganancias_dias <0)
		            {{--*/$totalxdias= $totalxdias - ($detalles->ganancias_dias*1);/*--}}
		            @else
		            {{--*/$totalxdias= $totalxdias + ($detalles->ganancias_dias*1);/*--}}
		            @endif
		        </tr>
		        @endforeach
		    </tbody>
		        <tr class="active">
		            <th colspan="12"><span class="pull-right">TOTAL</span></th>
		            <th>{{$total_ganancias}}</th>
		            <th></th>
		            <th>{{$totalxdias}}</th>
		        </tr>
		</table>
	</div>
</div>
@stop